package com.example.springbootwebrestfulcrud.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Auther: luzhanshi
 * @Date: 2021/2/27 - 02 - 27 - 15:16 
 * @Description: com.example.springbootwebrestfulcrud.servlet
 * @version: 1.0
 */

/**
 * 该servlet需要在MyServletConfig类里面注册到容器中
 */
public class MyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().write("helloServlet！！！");
    }
}
